Microsoft DirectX 8.1 (C++)

Using the Default UI (Visual Basic)

This topic applies to Windows XP Home Edition and Windows XP Professional only.

Microsoft TV Technologies provides a default UI for conditional access. This UI is not recommended for production code, but is useful for rapid prototyping or for testing new policies and tolls. The UI consists of two objects:

The dialog box contains the CAResDenialTree control, but an application can also place this control in its own form.

To display the dialog box automatically, set the CAManager.UseDefaultUI property to 1. The dialog box has controls for selecting and paying tolls. It also catches relevant events and updates itself.

To use the CAResDenialTree control, add it to your project's Toolbox:

  1. From the Project menu, choose Components.
  2. In the Components dialog box, click the Controls tab.
  3. Select Microsoft TV CA Type Library, then click OK. Visual Basic adds a button to the Toolbox.

Then draw the control onto your form. In your code, do the following:

  1. Set the CAResDenialTree.DisplayFields property. This property specifies which CA objects are displayed in the control. The standard setting includes everything except policies. For details, see CAUIDisplayFields Constants.
  2. Set the CAResDenialTree.CAManager property equal to the CAManager object. This step binds the control to the CAManager, so that it can receive events and update itself.

The following code illustrates these steps:

CAResDenialTree1.DisplayFields = 9  ' Show the request and the paid tolls.
CAResDenialTree1.CAManager = mCAManager ' Bind the tree to the CAManager.

The tree control enables the user to select tolls, but does not provide a way to pay them. Your application will need to catch TollStateChanged events and call CADenials.PaySelectedTolls. For more information, see Selecting and Paying Tolls (Visual Basic).